layui.use('form',function(){
	var form = layui.form,
		layer = layui.layer;
	
	$('#addDict').click(function(){
		var formData = form.val('dict-form');
		
		var parent_code = $('#parent_code').attr('data-value');
		var word_code = formData.word_code;
		var word_mean = formData.word_mean;
		var word_value = formData.word_value;
		
		layer.load(2);
		
		$.ajax({
			type : 'post'
			,dataType : 'json'
			,url : access_url+'/system/systemmanage/adddict'
			,contentType : 'application/json;charset=UTF-8'
			,data : JSON.stringify({
				parent_code : parent_code
				,word_code : word_code
				,word_mean : word_mean
				,word_value : word_value
			})
			,success : function(data){
				layer.closeAll('loading');
				if(data.code != 200){
					layer.msg(data.msg, {icon: 5});
					return;
				}
				parent.layer.alert(data.msg,{icon:6});
				if(isNull(parent_code)){
					parent.queryDictType();
				}
				parent.loadTable();
				parent.layer.closeAll('iframe');
			}
		})
	})
})

function transmitParam(parent_info){
	var parent_mean = parent_info.parent_mean;
	var parent_code = parent_info.parent_code;
	$('#parent_code').val(parent_mean);
	$('#parent_code').attr('data-value',parent_code);
}